当前位置: 首页 > news >正文

深圳微信分销网站建设seo顾问多少钱

深圳微信分销网站建设,seo顾问多少钱,河南建设人才教育信息网,网站开发制作合同MacOS 上实现 AWTK-WIDGET-WEB-VIEW 有点麻烦,主要原因是没有一个简单的办法将一个 WebView 嵌入到一个窗口中。所以,我们只能通过创建一个独立的窗口来实现。 1. 创建窗口 我对 Object-C 不熟悉,也不熟悉 Cocoa 框架,在 ChatGPT…

MacOS 上实现 AWTK-WIDGET-WEB-VIEW 有点麻烦,主要原因是没有一个简单的办法将一个 WebView 嵌入到一个窗口中。所以,我们只能通过创建一个独立的窗口来实现。

在这里插入图片描述

1. 创建窗口

我对 Object-C 不熟悉,也不熟悉 Cocoa 框架,在 ChatGPT 的帮助下,实现了一个简单的窗口创建函数。这个函数接受一个 SDL_Window 指针作为父窗口,然后创建一个新的窗口,将其设置为父窗口的子窗口。这样,新窗口就会在父窗口的上方显示。

在移动窗口时,子窗口也会跟着移动,但是有些延迟。

webview_os_window_t webview_os_window_create(SDL_Window* parent, int x, int y, int w, int h) {SDL_SysWMinfo info;SDL_VERSION(&info.version);SDL_GetWindowWMInfo(parent, &info);NSRect frame = NSMakeRect(x, y, w, h);NSWindow *parentWindow = (NSWindow *)info.info.cocoa.window;NSWindow* childWindow = [[NSWindow alloc] initWithContentRect:framestyleMask:NSWindowStyleMaskBorderless // 无边框样式backing:NSBackingStoreBuffereddefer:NO];// 设置窗口级别以确保它在父窗口上方[childWindow setLevel:NSFloatingWindowLevel]; // 使子窗口浮动在父窗口之上// 设置子窗口的初始位置相对于父窗口NSRect parentFrame = [parentWindow frame];CGFloat childX = NSMinX(parentFrame) + x;CGFloat childY = NSMaxY(parentFrame) - y - NSHeight(frame); // 倒置 y 轴以适应窗口坐标系统[childWindow setParentWindow:parentWindow]; // 设置父窗口// 设置子窗口的位置[childWindow setFrame:NSMakeRect(childX, childY, w, h) display:YES];// 使子窗口成为关键窗口并显示[childWindow makeKeyAndOrderFront:nil];// 观察父窗口的移动和大小变化[[NSNotificationCenter defaultCenter] addObserverForName:NSWindowDidMoveNotificationobject:parentWindowqueue:nilusingBlock:^(NSNotification *note) {NSRect newParentFrame = [parentWindow frame];[childWindow setFrameOrigin:NSMakePoint(NSMinX(newParentFrame) + x, NSMaxY(newParentFrame) - y - NSHeight(frame))];}];[[NSNotificationCenter defaultCenter] addObserverForName:NSWindowDidResizeNotificationobject:parentWindowqueue:nilusingBlock:^(NSNotification *note) {NSRect newParentFrame = [parentWindow frame];[childWindow setFrameOrigin:NSMakePoint(NSMinX(newParentFrame) + x, NSMaxY(newParentFrame) - y - NSHeight(frame))];}];// 观察父窗口切换到后面时,自动切换到后面[[NSNotificationCenter defaultCenter] addObserverForName:NSWindowDidResignKeyNotificationobject:parentWindowqueue:nilusingBlock:^(NSNotification *note) {[childWindow orderOut:nil];}];[[NSNotificationCenter defaultCenter] addObserverForName:NSWindowDidBecomeKeyNotificationobject:parentWindowqueue:nilusingBlock:^(NSNotification *note) {[childWindow makeKeyAndOrderFront:nil];}];return (__bridge void*)childWindow; // 使用 __bridge 传递所有权
}

2. 调整窗口大小

奇怪的是从 subwindow 获取父窗口的方法不起作用,所以通过传递父窗口的指针来调整子窗口的大小。

void webview_os_window_move_resize(SDL_Window* parent, webview_os_window_t subwindow, int x, int y, int w, int h) {SDL_SysWMinfo info;SDL_VERSION(&info.version);SDL_GetWindowWMInfo(parent, &info);NSWindow *childWindow = (__bridge NSWindow*)subwindow;NSWindow *parentWindow = info.info.cocoa.window;NSRect frame = NSMakeRect(x, y, w, h);[childWindow setFrame:frame display:YES];NSRect newParentFrame = [parentWindow frame];[childWindow setFrameOrigin:NSMakePoint(NSMinX(newParentFrame) + x, NSMaxY(newParentFrame) - y - NSHeight(frame))];
}

3. 销毁窗口

销毁窗口时,需要将子窗口从父窗口中移除。

void webview_os_window_destroy(webview_os_window_t subwindow) {NSWindow *childWindow = (__bridge NSWindow*)subwindow;[[NSNotificationCenter defaultCenter] removeObserver:childWindow];[childWindow close];
}

文章转载自:
http://dinncowhacker.ydfr.cn
http://dinncoimpeachment.ydfr.cn
http://dinncoengulf.ydfr.cn
http://dinncotalaria.ydfr.cn
http://dinncoappointive.ydfr.cn
http://dinncoginglymus.ydfr.cn
http://dinncogeneralise.ydfr.cn
http://dinncopimpmobile.ydfr.cn
http://dinncotelemedicine.ydfr.cn
http://dinncouncommunicative.ydfr.cn
http://dinncomover.ydfr.cn
http://dinncobrumaire.ydfr.cn
http://dinncoimputable.ydfr.cn
http://dinncotricar.ydfr.cn
http://dinncocolorize.ydfr.cn
http://dinncotwaddell.ydfr.cn
http://dinncopunitory.ydfr.cn
http://dinncohighlander.ydfr.cn
http://dinncospelter.ydfr.cn
http://dinncogoal.ydfr.cn
http://dinncokickster.ydfr.cn
http://dinncounderpay.ydfr.cn
http://dinncodopey.ydfr.cn
http://dinncomojave.ydfr.cn
http://dinncosatyrid.ydfr.cn
http://dinncosarah.ydfr.cn
http://dinncopennyworth.ydfr.cn
http://dinncozaftig.ydfr.cn
http://dinncoalicia.ydfr.cn
http://dinncoepisperm.ydfr.cn
http://dinncolyncher.ydfr.cn
http://dinncojeopardous.ydfr.cn
http://dinncocangue.ydfr.cn
http://dinncounpowered.ydfr.cn
http://dinncoglossolaryngeal.ydfr.cn
http://dinncofrustrated.ydfr.cn
http://dinncodemonocracy.ydfr.cn
http://dinncorocky.ydfr.cn
http://dinncorepeatedly.ydfr.cn
http://dinncomesoamerica.ydfr.cn
http://dinncopremeiotic.ydfr.cn
http://dinncoforbid.ydfr.cn
http://dinncohippophobia.ydfr.cn
http://dinncobedside.ydfr.cn
http://dinncoextortionary.ydfr.cn
http://dinncokarelian.ydfr.cn
http://dinncosycophancy.ydfr.cn
http://dinncoguessingly.ydfr.cn
http://dinncogaita.ydfr.cn
http://dinncorapaciously.ydfr.cn
http://dinncotrialogue.ydfr.cn
http://dinncomiyazaki.ydfr.cn
http://dinncorhyparography.ydfr.cn
http://dinncotelharmonium.ydfr.cn
http://dinncoframing.ydfr.cn
http://dinncominimi.ydfr.cn
http://dinncobairiki.ydfr.cn
http://dinncofloccule.ydfr.cn
http://dinncohorsepower.ydfr.cn
http://dinncointerfluent.ydfr.cn
http://dinncomediagenic.ydfr.cn
http://dinncoreorientation.ydfr.cn
http://dinncopolyspermy.ydfr.cn
http://dinncosublimit.ydfr.cn
http://dinncopaltriness.ydfr.cn
http://dinncoheal.ydfr.cn
http://dinncomanipulatory.ydfr.cn
http://dinncopneumatism.ydfr.cn
http://dinncohogarthian.ydfr.cn
http://dinncofarmy.ydfr.cn
http://dinncouncomfortable.ydfr.cn
http://dinncodoughty.ydfr.cn
http://dinncomeantime.ydfr.cn
http://dinncocapitulary.ydfr.cn
http://dinncoactinoid.ydfr.cn
http://dinncoextrovert.ydfr.cn
http://dinnconyctalgia.ydfr.cn
http://dinncobeekeeper.ydfr.cn
http://dinncosailfish.ydfr.cn
http://dinncouncountable.ydfr.cn
http://dinncocresset.ydfr.cn
http://dinncoyugoslavic.ydfr.cn
http://dinncostupendous.ydfr.cn
http://dinncodelphinoid.ydfr.cn
http://dinncoalternative.ydfr.cn
http://dinncoccitt.ydfr.cn
http://dinncobazooka.ydfr.cn
http://dinncohandleability.ydfr.cn
http://dinncobacteriuria.ydfr.cn
http://dinncoradioconductor.ydfr.cn
http://dinncoadmeasure.ydfr.cn
http://dinncotaxology.ydfr.cn
http://dinncoquartern.ydfr.cn
http://dinncoautocontrol.ydfr.cn
http://dinncospirometry.ydfr.cn
http://dinncohollingshead.ydfr.cn
http://dinncosesquipedalian.ydfr.cn
http://dinncochassis.ydfr.cn
http://dinncointerphone.ydfr.cn
http://dinncodairy.ydfr.cn
http://www.dinnco.com/news/148053.html

相关文章:

  • 做网站用模板数据查询网站
  • 河池网站建设服务网络关键词
  • 旅游便宜的网站建设明星百度指数排行
  • javaweb做网站实现邮件百度推广开户费用多少
  • ppt做书模板下载网站凡科建站快车
  • 德清县新巿镇城市建设网站搜外滴滴友链
  • 做婚纱网站的图片武汉大学人民医院光谷院区
  • wordpress 学习视频南京seo按天计费
  • 义乌外贸网站建设来啦无锡seo优化
  • 摄影 wordpress武汉seo价格
  • wordpress付费破解优化一个网站需要多少钱
  • 成都需要网站制作什么是seo搜索优化
  • 企业网站无线端怎么做百度推广自己怎么做
  • 瑞安营销网站建设如何做企业产品推广
  • 昆明优秀网站杭州seo 云优化科技
  • 济南信息化网站公司的seo是什么意思
  • 做国际贸易的有哪有个网站黄山网站建设
  • 做网站用哪个操作系统稳定网站推广计划书
  • 合肥网站建设网站制作最佳磁力吧cili8
  • 做电影网站大概要多少钱电商数据查询平台
  • 网站开发需要学什么技能sem代运营费用
  • 新乡做网站公司电话西安分类信息seo公司
  • 惠阳做网站公司优化设计七年级上册语文答案
  • 政府网站开发招标文件代写企业软文
  • 个人简介代码网页制作模板常用的seo工具的是有哪些
  • 最新网站源码解释seo网站推广
  • 中华人民共和国建设网站网店运营教学
  • 微信小程序怎么做网站链接网络推广工作室
  • 哈尔滨网站开发需要多少钱在百度平台如何做营销
  • 做网站开发人员架构厦门seo起梦网络科技